<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class MenuItemSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $menuItems = [
            // 主导航菜单项
            [
                'menu_id' => 1,
                'parent_id' => null,
                'title' => '首页',
                'url' => '/',
                'target' => '_self',
                'order' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'menu_id' => 1,
                'parent_id' => null,
                'title' => '技术分享',
                'url' => '/category/tech',
                'target' => '_self',
                'order' => 2,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'menu_id' => 1,
                'parent_id' => 2,
                'title' => 'PHP开发',
                'url' => '/category/php',
                'target' => '_self',
                'order' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'menu_id' => 1,
                'parent_id' => 2,
                'title' => 'JavaScript',
                'url' => '/category/javascript',
                'target' => '_self',
                'order' => 2,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'menu_id' => 1,
                'parent_id' => null,
                'title' => '关于我们',
                'url' => '/page/about',
                'target' => '_self',
                'order' => 3,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'menu_id' => 1,
                'parent_id' => null,
                'title' => '联系我们',
                'url' => '/page/contact',
                'target' => '_self',
                'order' => 4,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            
            // 底部菜单项
            [
                'menu_id' => 2,
                'parent_id' => null,
                'title' => '隐私政策',
                'url' => '/page/privacy',
                'target' => '_self',
                'order' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'menu_id' => 2,
                'parent_id' => null,
                'title' => '服务条款',
                'url' => '/page/terms',
                'target' => '_self',
                'order' => 2,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'menu_id' => 2,
                'parent_id' => null,
                'title' => '帮助中心',
                'url' => '/page/help',
                'target' => '_self',
                'order' => 3,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            
            // 侧边栏菜单项
            [
                'menu_id' => 3,
                'parent_id' => null,
                'title' => '最新文章',
                'url' => '/posts/latest',
                'target' => '_self',
                'order' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'menu_id' => 3,
                'parent_id' => null,
                'title' => '热门标签',
                'url' => '/tags',
                'target' => '_self',
                'order' => 2,
                'created_at' => now(),
                'updated_at' => now(),
            ],
        ];

        DB::table('menu_items')->insert($menuItems);
    }
}